package com.nervenets.utils;

import java.util.Random;

public class RandomUtil {
    static Random random;

    static Random getInstance() {
        if (random == null)
            random = new Random();
        return random;
    }

    public static int randomInt(int min, int max) {
        if (min == max && max == 0)
            return 0;
        return getInstance().nextInt(max) % (max - min + 1) + min;
    }
}
